<?php

function dme($var)
{
  echo "<pre>";
  print_r($var);
  echo "</pre>";
}

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
  public function _initSetLanguage()
  {
    define("LANGUAGE", "en");
  }

  public function _initConditions()
  {
    $config = new Zend_Config_Ini(dirname(__FILE__).'/configs/body-condition.ini');
    Zend_Registry::set('body-conditions', $config->toArray());
  }

  public function _initStatic()
  {
	$aConfig = $this->getOptions();

	foreach ((array)$aConfig['static'] as $key => $var)
	  define($key, $var);
  }

  public function _initRouter()
  {
	// create $frontController if not already initialised
	$frontController = Zend_Controller_Front::getInstance(); 
	$config = new Zend_Config_Ini(APPLICATION_PATH . "/configs/routes.ini");
	$router = $frontController->getRouter();
	$router->addConfig($config, "routes");
  }
  public function _initStripe()
  {
	$aConfig = $this->getOptions();
 
	include_once(APPLICATION_PATH."/../library/Stripe/lib/Stripe.php");
    Stripe::setApiKey($aConfig['stripe']['key']['secret']);
  }
}
